package com.lenovo.spider.domain;

import cn.hutool.core.map.MapUtil;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author <a href="mailto:liuhan3@lenovo.com">HanL(liuhan3)</a>
 * on 2018/3/19 18:11
 */
@Data
public class ResultItem implements Serializable {
    private String url;
    private LocalDateTime createTime;
    private Map<String, Object> data;

    public ResultItem(String url) {
        this.url = url;
        this.createTime = LocalDateTime.now();
        this.data = MapUtil.newHashMap();
    }

    public ResultItem addItem(String key, Object value) {
        this.data.put(key, value);
        return this;
    }

}
